<?php

# 绒博汇小程序

use Illuminate\Support\Facades\Route;

Route::namespace('RbhMiniProgram')->prefix('mini')->middleware('signature')->group(function ($route) {
    $route->prefix('user')->group(function ($r) {
        $r->any('get_openid', MiniProgramUserController::class.'@getUserOpenId');
        $r->any('get_mobile', MiniProgramUserController::class.'@getUserMobile');
        $r->any('login', MiniProgramUserController::class.'@doSave');
        $r->any('get_info', MiniProgramUserController::class.'@getUserInfo');
    });
    $route->prefix('home')->group(function ($r) {
        $r->any('list', MiniProgramHomeController::class.'@getHomeList');
    });
    $route->prefix('goods')->group(function ($r) {
        $r->any('list', MiniProgramGoodsController::class.'@getList');
        $r->any('supply/list', MiniProgramGoodsController::class.'@getSupplyGoodsList');
        $r->any('info', MiniProgramGoodsController::class.'@getGoodsInfo');
        $r->any('download/update', MiniProgramGoodsController::class.'@updateGoodsBuyNum');
    });
    $route->prefix('store')->group(function ($r) {
        $r->any('goods/list', MiniProgramStoreController::class.'@getGoodsList');
        $r->any('supply/list', MiniProgramStoreController::class.'@getGoodsList');
        $r->any('save', MiniProgramStoreController::class.'@doSave');
    });
    $route->prefix('verify')->group(function ($r) {
        $r->any('send', MiniProgramSupplyController::class.'@getList');
    });
});

Route::namespace('RbhMiniProgram')->prefix('mini')->middleware('api')->group(function ($route) {
    $route->get('supply/parse_business', MiniProgramSupplyController::class.'@parseBusinessLicenceToText');
    $route->any('supply/list', MiniProgramSupplyController::class.'@getList');
    $route->any('supply/info', MiniProgramSupplyController::class.'@getSupplyInfo');
});
